package com.ucode.model.hrm.enums;

import com.ucode.tool.base.IntArrayValuable;

import java.util.Arrays;

/**
 * 员工合同状态枚举类
 */
public enum HrmEmployeeContractStatusEnum implements IntArrayValuable {
    DRAFT(1,"草稿"),
    EMPLOYEE_PENDING(2,"员工待签署"),
    COMPANY_PENDING(3,"公司待签署"),
    COMPLETED_SIGNED(4,"完成签署"),
    EXPIRED(5,"已过期"),
    TERMINATED(6,"已终止");


    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(HrmEmployeeContractStatusEnum::getCode).toArray();

    public Integer code;

    public String message;

    HrmEmployeeContractStatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
    
    public static HrmEmployeeContractStatusEnum get(Integer code){
        for(HrmEmployeeContractStatusEnum dataPermissionType : values()){
            if(dataPermissionType.code == code){
                return dataPermissionType;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public int[] array() {
        return ARRAYS;
    }
}